{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">会员列表</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
    </div>
</div>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <a class="layui-btn layui-btn-sm layui-btn-danger confirm layui-batch-all" data-href='{:url("delete")}'>批量删除</a>
        <a class="layui-btn layui-btn-sm" href="{:url('add')}">添加会员</a>
    </div>
</script>
<script type="text/html" id="barTool">
    <a href='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs">编辑</a>
    <a href='{:url("delete")}?ids={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
</script>
{/block}
{block name="script"}
<script>
layui.use('table', function() {
    var table = layui.table,
        $ = layui.$,
        form = layui.form;
    table.render({
        elem: '#dataTable',
        toolbar: '#toolbarDemo',
        url: '{:url("manage")}',
        cols: [
            [
                { type: 'checkbox', fixed: 'left' },
                { field: 'id', width: 80, title: '用户ID' },
                { field: 'username', width: 150, title: '用户名' },
                { field: 'nickname', width: 150, title: '昵称' },
                { field: 'email',  title: '邮箱' },
                { field: 'reg_ip', title: '注册IP' },
                { field: 'last_login_time', title: '最后登录' },
                { field: 'amount', width: 120, title: '金钱总数' },
                { field: 'point', width: 120, title: '积分总数' },
                { field: 'login', width: 100, title: '登录次数' },
                { fixed: 'right', width: 120, title: '操作', templet: '#barTool' }
            ]
        ]
    });
});
</script>
{/block}